#include    "aperiodic-filter.h"

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
AperiodicFilter::AperiodicFilter(double T, QObject *parent)
    : Device(parent)
    , T(T)
    , u(0.0)
{

}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
AperiodicFilter::~AperiodicFilter()
{

}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void AperiodicFilter::preStep(state_vector_t &Y, double t)
{
    Q_UNUSED(t)
    Q_UNUSED(Y)
}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void AperiodicFilter::ode_system(const state_vector_t &Y,
                                 state_vector_t &dYdt,
                                 double t)
{
    Q_UNUSED(t)

    dYdt[0] = (u - Y[0]) / T;
}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void AperiodicFilter::load_config(CfgReader &cfg)
{

}
